<template>
  <el-dialog
    append-to-body
    :close-on-click-modal="false"
    :before-close="crud.cancelCU"
    :title="crud.status.title"
    width="500px"
  >
    <el-form
      label-width="100px"
      size="small"
      ref="form"
      :model="form"
      :rules="rules"
    >
      <el-form-item label="用法名称" prop="name">
        <el-input v-model="form.name" placeholder="请输入用法名称" />
      </el-form-item>
      <el-form-item label="状态" prop="status">
        <el-select v-model="form.status">
          <el-option :value="0" label="正常"></el-option>
          <el-option :value="1" label="无效"></el-option>
        </el-select>
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button type="text" @click="crud.cancelCU">取消</el-button>
      <el-button :loading="crud.procesLoading" type="primary" @click="crud.submitCU">确认</el-button>
    </div>
  </el-dialog>
</template>

<script>
import CRUD, { form } from '@crud/crud';

const regionCache = {};
const defaultForm = {
  name: "",
  pharmacyId: 0,
  status: 0,
  type: 2
}

export default {
  name: "useForm",
  mixins: [ form(defaultForm) ],
  data() {
    return {
      rules: {
        name: [
          { required: true, message: '请输入用法名称', trigger: 'blur' }
        ]
      }
    }
  },
  methods: {
    [CRUD.HOOK.afterToEdit]() {
      
    }
  }
}
</script>